package com.sunlake.spring.main.model.orders.mapper;

import com.sunlake.spring.main.model.orders.po.OrdersPO;
import org.apache.ibatis.annotations.Mapper;
import org.apache.ibatis.annotations.Param;

import java.util.List;

/**
 * @author liuhanzhi49
 * @description 针对表【orders】的数据库操作Mapper
 * @createDate 2025-09-23 15:10:48
 * @Entity com.sunlake.spring.main.model.orders.po.Orders
 */
@Mapper
public interface OrdersMapper {

    int deleteByPrimaryKey(Long id);

    int insert(OrdersPO record);

    int insertSelective(OrdersPO record);

    OrdersPO selectByPrimaryKey(Long id);

    OrdersPO selectByOrderNo(@Param("orderNo") String orderNo);

    int updateByPrimaryKeySelective(OrdersPO record);

    int updateByPrimaryKey(OrdersPO record);

    // 分页查询方法
    List<OrdersPO> selectByUserIdAndConditions(@Param("userId") Long userId,
                                               @Param("type") String type,
                                               @Param("status") String status,
                                               @Param("paymentStatus") String paymentStatus,
                                               @Param("startTime") String startTime,
                                               @Param("endTime") String endTime);
}